{include file="public/header" /}



<div class="page">
   <table border="0" cellpadding="0" cellspacing="0" class="store-joinin ds-default-table">
       <thead>
           <tr>
               <th colspan="20">基本信息：</th>
           </tr>
       </thead>
       <tbody>
            <tr>
               <th class="w150">设备名称</th>
               <td>{$joinin_detail.equipment_name}</td>
           </tr>
           <tr>
               <th>分类名称：</th>
               <td>{$joinin_detail.gc_name}</td>
           </tr>
           <tr>
               <th>品牌名称：</th>
               <td>{$joinin_detail.b_name}</td>
           </tr>
           <tr>
               <th>规格：</th>
               <td>{$joinin_detail.bricks_spec}</td>
           </tr>
           <tr>
               <th class="w150">型号：</th>
               <td>{$joinin_detail.bricks_type}</td>
           </tr>
       </tbody>
   </table>
      <table border="0" cellpadding="0" cellspacing="0" class="store-joinin ds-default-table">
       <thead>
           <tr>
               <th colspan="20">文件信息：</th>
           </tr>
       </thead>
       <tbody>
            <tr>
               <th class="w150">设备图片：</th>
               <td><img width="400px" height="300px" src="{$http_name}/{$joinin_detail.bricks_images}" /></td>
           </tr>
       </tbody>
   </table>
   
  <form id="form_store_verify" action="{:url('Equipment/bricks_verify')}" method="post">
    <input id="verify_type" name="verify_type" type="hidden" />
    <input name="id" type="hidden" value="{$joinin_detail.id}" />
    <table border="0" cellpadding="0" cellspacing="0" class="store-joinin ds-default-table">
      <thead>
        <tr>
          <th colspan="20">申请人信息</th>
        </tr>
      </thead>
      <tbody>
        {if $joinin_detail.is_store == 0}
        <tr>
          <th class="w150">提交人：</th>
          <td>平台提交</td>
        </tr>
        {/if}

        {if $joinin_detail.is_store != 0}
        <tr>
          <th class="w150">用户名：</th>
          <td>{$member_name.member_name}</td>
        </tr>
        {/if}

        <tr>
               <th>申请时间：</th>
               <td>{$joinin_detail.create_time|date="Y-m-d H:i:s",###}</td>
        </tr>
        {if $joinin_detail.is_store != 0}
          {if $is_verify == true}
          <tr>
              <th>审核意见：</th>
              <td colspan="2"><textarea style="width: 250px;height:150px;" id="joinin_message" name="joinin_message"></textarea><div id="validation_message" style="color:red;display:none;"></div></td>
          </tr>
          {/if}
          {if $is_verify == false}
          <tr>
              <th>审核意见：</th>
              <td colspan="2"><textarea style="width: 250px;height:150px;" id="joinin_message" name="joinin_message">{$joinin_detail.bricks_reason}</textarea><div id="validation_message" style="color:red;display:none;"></div></td>
          </tr>
          {/if}
        {/if}
    </tbody>
    </table>
    
    {if $is_verify == true}
    <div style="text-align: center;"><a id="btn_fail" class="btn" href="JavaScript:void(0);"><span>{$Think.lang.ds_refuse}</span></a> <a id="btn_pass" class="btn" href="JavaScript:void(0);"><span>{$Think.lang.ds_pass}</span></a></div>
    {/if}
  </form>
</div>
<link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/css/lightbox.min.css">
<script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/js/lightbox.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('#btn_fail').on('click', function() {
            if($('#joinin_message').val() == '') {
                $('#validation_message').text('请输入审核意见');
                $('#validation_message').show();
                return false;
            } else {
                $('#validation_message').hide();
            }
            layer.confirm("确定要拒绝吗", {
                btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
                title: false,
            }, function () {
                $('#verify_type').val('fail');
                $('#form_store_verify').submit();
            });
        });
        $('#btn_pass').on('click', function() {
            var valid = true;
            $('[dstype="commis_rate"]').each(function(commis_rate) {
                rate = $(this).val();
                if(rate == '') {
                    valid = false;
                    return false;
                }

                var rate = Number($(this).val());
                if(isNaN(rate) || rate < 0 || rate >= 100) {
                    valid = false;
                    return false;
                }
            });
            if(valid) {
                $('#validation_message').hide();
                layer.confirm("确定要审核通过吗", {
                    btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
                    title: false,
                }, function () {
                    $('#verify_type').val('pass');
                    $('#form_store_verify').submit();
                });
            } else {
                $('#validation_message').text('{$Think.lang.store_class_commis_rates_error}');
                $('#validation_message').show();
            }
        });
    });
</script>